﻿@model  P2PWeb.Models.Pager<P2PWeb.Models.Agent>
@using P2PWeb.Controllers;
@using P2PWeb.Common
@using P2PWeb;


<table cellpadding="0" cellspacing="0" width="100%">
    <tbody>
        <tr class="total_th">
            <th class="name">代理商编号</th>
            <th>代理商名称</th>
            <th>代理商类型</th>
            <th>分润比例</th>
            <th>代理商地址</th>
            <th>代理商网址</th>
            <th class="last_th">操作</th>
        </tr>
        <tr class="">
            <th colspan="6">&nbsp;</th>
        </tr>

        @foreach (P2PWeb.Models.Agent agent in Model.Items)
        {
            <tr class="first_td">
                <td class="left_td">@agent.ID
                </td>
                <td>@agent.Name</td>
                <td>@agent.AgentType</td>
                <td>@(agent.Ratio)
                </td>
                <td>@agent.Address</td>
                <td>@agent.Url</td>
                <td>
                    <a href="/Agent/UpdateAgentInfo?id=@agent.ID">修改</a>
                    <a href="/Agent/DeleteAgentInfo?id=@agent.ID" id="btnDelete">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>

<div id="navDiv" class="loan_page">

    <script>
        $(document).ready(function () {
            $('#searchBtn').click(function(){
                var borrowStateValues=[];
                $(":checkbox[name=borrowStateValues]:checked").each(function(){
                    borrowStateValues.push($(this).val());
                });

                var borrowStateValuesJson={};
                for(var index in borrowStateValues)
                {
                    borrowStateValuesJson[index]=borrowStateValues[index];
                }

                NavToPage(1,"myborrows","#borrowsContainer",{BorrowStateValues:borrowStateValuesJson})
            });

            var currentborrowStateValues= [];
            $(":checkbox[name=borrowStateValues]:checked").each(function(){
                currentborrowStateValues.push($(this).val());
            });

            var currentborrowStateValuesJson={};
            for(var index in currentborrowStateValues)
            {
                currentborrowStateValuesJson[index]=currentborrowStateValues[index];
            }

            MakerNavs('Agent','index',@Model.CurrentPageIndex,@Model.TotialPaqgerCount,@Model.Items.Count,@Model.TotialItemsCount,'navDiv','borrowsContainer',{BorrowStateValues:currentborrowStateValuesJson});
        });
    </script>
</div>
